<?php
/**
 * Created by PhpStorm.
 * User: gesangdianzi
 * Date: 2018/1/14
 * Time: 11:57
 */

$js  = <<<JS
$(".right-banner .item,.right-banner .top").hover(function() {
    var ths = $(this).find("img").eq(0);
    ths.prop("src",ths.data("h"))
},function() {
    var ths = $(this).find("img").eq(0);
    ths.prop("src",ths.data("old"))
});
$(".right-banner img.wx").animate({width:0,height:0,top:120,left:0,"max-width":126},400).fadeOut(400);
$(".right-banner .item.wx").hover(function() {
  $(".right-banner img.wx").animate({width:126,height:126,top:120,left:-152,"max-width":126},200).fadeIn(200);
},function() {
  $(".right-banner img.wx").animate({width:0,height:0,top:120,left:0},400).fadeOut(400);
});

$(".right-banner div.ppp").fadeOut(400);
$(".right-banner .item.phone").hover(function() {
  $(".right-banner div.ppp").animate({width:126,height:40,top:78,left:-152},200).fadeIn(200);
},function() {
  $(".right-banner div.ppp").fadeOut(400);
});

$(".right-banner .top").on("click",function() {
  $("body,html").animate({"scrollTop":0},500);
});
JS;
/**
 * @var $this \yii\web\View
 */
$this->registerJs($js);
?>
<style>
    .ppp{
        position: absolute;
        padding: 10px;
        height: 40px;
        border: 1px solid ;
        background: #fff;
        font-size: 16px;
    }
</style>
<div class="right-banner">
    <div class="item">
        <a href="tel:<?=Yii::$app->params['phone']?>">
        <img src="/img/kf.png" data-old="/img/kf.png" data-h="/img/kf_2.png">
        <p>客服</p>
        </a>
    </div>
    <div class="item phone">
        <a href="tel:<?=Yii::$app->params['phone']?>">
        <img src="/img/dh.png" data-old="/img/dh.png" data-h="/img/dh_2.png">
        <p>电话</p>
        </a>
    </div>
    <div class="item wx">
        <img src="/img/wx.png" data-old="/img/wx.png" data-h="/img/wx_2.png">
        <p>微信</p>
    </div>
    <div class="top">
        <img src="/img/ttop.png" data-old="/img/ttop.png" data-h="/img/ttop_2.png">
    </div>
    <img src="/img/wxew.png" class="wx">
    <div class="ppp"><?=Yii::$app->params['phone']?></div>
</div>